package org.gd.hellojaxb.other;

public class Main {

    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                /*
                    System.out.println(String.format("%.0f", new Double(0)));
                */
                /*
                    final long t = 13899;
                    System.out.println(new SimpleDateFormat("mm:ss.SSS", new Locale("UA")).format(new Date(t)) + " (" + t + ")");
                */
                /*
                    String date_end = new SimpleDateFormat("yyyy MM dd 00:00:00").format(new Date());
                    Calendar d = new GregorianCalendar(new Locale("UA"));
                    d.add(Calendar.MONTH, -1);
                    String date_start = new SimpleDateFormat("yyyy MM dd 23:59:59").format(d.getTime());
                */
                /*
                    endate	25.01.2013
                    state	%
                    stdate	25.12.2012
                */

                /*
                System.out.println();
                System.out.println("25.01.2013".matches("^\\d{2}[.]{1}\\d{2}[.]{1}\\d{4}$"));
                System.out.println();


                String date = "2013-01-21 18:48:27.45";
                try {
                    date = new SimpleDateFormat("dd MMMM yyyy HH:mm", new Locale("uk", "UA")).format(
                            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS").parse(date));
                    System.out.println(date);

                    System.out.println(Currency.getInstance("UAH").getSymbol(new Locale("uk", "UA")));
                } catch (Throwable e) {
                    e.printStackTrace();
                }
                */

                /*Header h = new Header("header", "content");
                try {
                    System.out.println();
                    System.out.println(Marshall.marshal(h.getClass(), h,
                            Marshaller.JAXB_FORMATTED_OUTPUT,
                            Marshaller.JAXB_FRAGMENT));
                } catch (Exception e) {
                    e.printStackTrace();
                } finally {
                    Thread.currentThread().stop();
                    //System.exit(0);
                }*/


                String type = "";
                String credit = "";

                String creditId = "";
                String baseNum = "";
                String date1 = "";
                String date2 = "";

                StringBuilder xmlRequest = new StringBuilder();
                xmlRequest.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
                xmlRequest.append("<mes type=\"creditStatement\">");
                xmlRequest.append("<credit type=\"").append(type == null ? credit : type).append("\" ");
                xmlRequest.append("creditId=\"").append(creditId).append("\" ");
                xmlRequest.append("baseNum=\"").append(baseNum).append("\" ");
                xmlRequest.append("date1=\"").append(date1).append("\" ");
                xmlRequest.append("date2=\"").append(date2).append("\" ");
                xmlRequest.append("/>");
                xmlRequest.append("</mes>");

                System.out.println(xmlRequest);

                System.out.println(
                        "<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                        "<mes type=\"creditStatement\"> " +
                        "  <credit type=\"\" creditId=\"\" baseNum=\"\" date1=\"\" date2=\"\" /> " +
                        "</mes> ");

            }
        }).start();
    }
}
